Repository navigation
rolldown: turn off constant inlining by default - #214
Merged
NullVoxPopuli merged 2 commits intoNov 21, 2026
Merged
NullVoxPopuli merged 2 commits into
NullVoxPopuli merged 2 commits into
Conversation
rolldown's default `optimization.inlineConst` (`mode: "smart"`) puts an
imported constant's literal into `precompileTemplate` scope objects.
`scope: () => ({ EMPTY })` becomes `scope: () => ({ EMPTY: "—" })`.
The consuming app's template compiler accepts only direct references
there, so the published library fails when the app compiles it.
`emberConfig()` now sets `optimization.inlineConst` to `false` through
rolldown's `options` hook, so the default holds under tsdown and plain
rolldown. An explicit `optimization` value still wins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NullVoxPopuli
approved these changes
Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #114, rebased onto the newest
main. The agent account cannot push to the #114 branch, so this PR comes from the agent fork.emberConfig()now sets rolldown'soptimization.inlineConsttofalseby default. rolldown's default (mode: "smart") puts an imported constant's literal intoprecompileTemplatescope objects:The consuming app's template compiler rejects that output with "Scope objects for
precompileTemplatemay only contain direct references to in-scope values ... Found StringLiteral". The library builds, type-checks, and lints clean, so the first error shows when the app boots.On 2026-11-21 this still happened with rolldown 1.3.3, the newest version for
^1.2.0. The upstream compiler issue, emberjs/babel-plugin-ember-template-compilation#116, is still open. Its fix, emberjs/babel-plugin-ember-template-compilation#125, makes the compiler accept literal scope values and waits for review. Apps on 4.0.1 or older still reject inlined constants, so this default stays useful after #125 releases.The default goes through rolldown's
optionshook, so it holds under tsdown and plain rolldown. An explicitoptimizationvalue still wins.src/config.test.tsruns real rolldown builds. It covers the rolldown default that inlines the constant, theemberConfig()default that keeps the reference, and explicit options that still win.These tests did not run locally. CI runs them.
🤖 Generated with Claude Code